﻿using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using RestService.Models;

namespace RestService
{
    [ServiceContract]
    public interface IGeoService
    {
        #region Default_services
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "CreateGame")]
        string CreateGame(Game game);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "CreateArea")]
        string CreateArea(Area area);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "CreateAreaTest")]
        string CreateAreaTest();

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "CreatePlayer")]
        string CreatePlayer(Player player);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "CreatePlayerTest")]
        string CreatePlayerTest();

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetGameArea/{gameName}")]
        Area GetGameArea(string gameName);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetPoints/{id_game}/{id_player}")]
        string GetPoints(string id_game, string id_player);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetPlayerPoints/{playerID}/{gameID}/{latitude}/{longitude}")]
        List<PlayerStatus> getPlayerPoints(string playerID,string gameID,string latitude,string longitude);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "ClearDataBase")]
        string clearDataBase();

        [OperationContract]
        [WebGet(
            UriTemplate = "GetPlates",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        IList<string> GetPlates();
        #endregion

        [OperationContract]
        [WebInvoke(Method = "GET",
            UriTemplate = "GetAllGames",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        List<GamesToSend> GetAllGames();

        [OperationContract]
        [WebInvoke(
            Method = "POST",
            UriTemplate = "SaveVehicle",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        void SaveVehicle(Vehicle vehicle);


        //Usługa zapisuje współrzędne gracza 
        //do serwisu
        [OperationContract]
        [WebInvoke( Method = "POST",
            UriTemplate = "SaveCurrentPoint",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        void SaveCurrentPoint(newPlayerStatus vehicle);

        //Usułga zwraca wspórzędne pozostałych graczy
        //z powrotem do klienta
        [OperationContract]
        [WebInvoke(UriTemplate = "GetCurrentPoints",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        List<newPlayerStatus> GetCurrentPoints(newPlayerStatus vehicle);
    }
}